#ifndef SCANNER
#define SCANNER

#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
#include <vector>
#include <map>

using namespace std;

class Scanner {
 public:
  //Scanner utilities
  int readFile(char*);
  string next();
  string nextLine();
  string start_state;

  //Constructing Grammar methods
  void readGrammar();
  void makeRules();
  string getStartState();
  vector<string>* getTokens();
  vector<string>* getNon_terminals();
  map< string, vector<string> >* getGrammar();
  map< string, vector<string> > grammar_map;

  //Testing Print Methods
  void printVectors();
  void printGrammar();

  //Matching utilities
  string matchSymbol(string);
  bool checkNumber(string);
  bool checkID(string symbol);
  bool strCmpIgnoreCase(string input, string compareto) ;

  //Constructor + Deconstructor
  Scanner();
  ~Scanner();

 private:
  string contents; //File contents
  istringstream *ss; //Main File reader
  
  vector< vector<string> > grammar;
  vector<string> tokens;
  vector<string> non_terminals;
};

#endif
